1. Field of the Invention
The present invention relates to a method and related device for receiving data over an SDIO interface, and more particularly, to a data reception method and related device for enhancing data transmission rate by reducing the number of required control signals.
2. Description of the Prior Art
Secure digital input output (SDIO) interfaces are extended from secure digital (SD) interfaces, which not only can be applied in storage devices like flash memory cards, but also can be used to drive peripheral devices such as Wi-Fi wireless network cards, global positioning system (GPS) receivers, and Bluetooth adapters. Thus, with increasing requirements for functions in portable electronic products, the applications of the SDIO interface have become more and more widespread.
The SDIO interface is not a sort of high-speed data transmission interface. Despite the theoretical data transmission rate claimed by the SDIO interface specification of up to 100 Mbps, the bandwidth capability for practical applications is only about 10 percent, or even less than 10 percent, of the theoretical data rate. According to the SDIO interface specification, reasons for the data rate being lower than expectation can be roughly generalized as: redundant overhead of headers, transmission of control commands by sequential bits, long delay between two commands (or CMD-CMD Intervals), and a handshake mechanism, etc. To reduce the restrictions of the above specification, the data rate of the SDIO interface can be enhanced by transferring data with data blocks. However, due to the bus driver limitations of operating systems, the data rate and performance of the SDIO interface are not really improved when the data transfer is performed with larger data blocks. For example, in WinCE systems, the best data rate of the SDIO interface is achieved when data transmission is performed using 32-byte data blocks.
Generally speaking, at least two signal lines are needed in the SDIO interface for performing data transmission, among which one is utilized for transmitting control signals of a master device, such as commands, and the others are utilized for transmitting data. Please refer to FIG. 1. FIG. 1 is a timing diagram of a conventional SDIO interface performing data transfer. As shown in FIG. 1, the SDIO interface is utilized for providing a data transmission connection between a master device and a slave device, and includes a command line CMD_LINE and a data line DATA_LINE. When the slave device has a packet required for transmitting, the master device is triggered to initiate an interrupt procedure according to an interrupt signal INT sent by the slave device, and to generate an IO_RW_DIRECT command CMD52 to read status of the interrupt procedure from the slave device for obtaining related packet reception information. Then, the master device enters into a packet reception state and generates an IO_RW_EXTENDED command CMD53 to enable the slave device to transfer a first data block BLK_1 with a specific data length through the data line DATA_LINE, among which the first data block BLK_1 contains status information and data length information of the packet. Therefore, by the status information and the data length information of the packet obtained from the received first data block BLK_1, the master device can further generate another IO_RW_EXTENDED command CMD53 to make the slave device begin transmitting data of the packet in the form of data blocks (i.e. data blocks BLK_2 to BLK_n), wherein the number of the data blocks BLK_2 to BLK_n corresponds to data length of the packet, and data length of each data block is the same. After receiving the data blocks BLK_2 to BLK_n, the master device terminates the interrupt procedure to complete reception of the packet. In other words, when there is a next packet required to be transmitted, the slave device has to generate another interrupt signal to trigger the master device to re-enter the packet reception state.
As mentioned above, while receiving a packet from the slave device, the master device at least has to generate one IO_RW_DIRECT command CMD52 and two IO_RW_EXTENDED commands CMD53 to complete the data transfer of the packet. Besides, when the slave device has multiple continuous packets for transmitting, since the master device immediately terminates the interrupt procedure after completing reception of each packet, to receive a next packet, the master device needs to be triggered by the interrupt signal and generate the IO_RW_DIRECT command CMD52 again to re-read status of the interrupt procedure and the related reception information. However, in a multi-thread system, such as WinCE, a system bus driver has to manage interrupt requests of multiple peripheral devices, and thus long time intervals must pass between two control commands of the SDIO interface. Please refer to FIG. 2. FIG. 2 is a schematic diagram of time intervals between control commands of a conventional SDIO interface. As shown in FIG. 2, the time intervals between two control commands are substantially 100 operation cycles of the control commands. Thus, if operation of an SDIO interface peripheral device needs more control commands, more time is wasted on time delays between the control commands, resulting in the data rate being reduced significantly. If the number of required control commands could be reduced when the master device performs data reception over the SDIO interface, the data rate will be improved dramatically.